package array

// MySum is used to get sum for int array
func MySum(array []int) (sum int) {
	for _, item := range array {
		sum += item
	}
	return
}

// SumAll is used to get sum for some array
func SumAll(arrays ...[]int) (sum []int) {
	for _, item := range arrays {
		sum = append(sum, MySum(item))
	}
	return
}

// SumAllTails is used to get sum for some array without fisrt item
func SumAllTails(arrays ...[]int)(sum []int){
	for _, item := range arrays {
		if len(item) != 0 {
			sum = append(sum, MySum(item[1:]))
		}else {
			sum = append(sum, 0)
		}
	}
	return
}
